lib_LTLIBRARIES = \
libtppmc.la

include_HEADERS = \
$(top_srcdir)/include/tppmc/Event.h \
$(top_srcdir)/include/tppmc/Particle.h

libtppmc_la_SOURCES = \
$(top_srcdir)/src/Application.cxx \
$(top_srcdir)/src/Bins.cxx \
$(top_srcdir)/src/CollinsFragmentation.cxx \
$(top_srcdir)/src/CollinsKt.cxx \
$(top_srcdir)/src/Configuration.cxx \
$(top_srcdir)/src/ConstantFragmentation.cxx \
$(top_srcdir)/src/Distributions.cxx \
$(top_srcdir)/src/DssFragmentation.cxx \
$(top_srcdir)/src/Dssv.cxx \
$(top_srcdir)/src/Event.cxx \
$(top_srcdir)/src/fDSS.f \
$(top_srcdir)/src/grv98.f \
$(top_srcdir)/src/Grv98Pdf.cxx \
$(top_srcdir)/src/KeyedLists.cxx \
$(top_srcdir)/src/KkpParton.cxx \
$(top_srcdir)/src/parameters.cc \
$(top_srcdir)/src/Particle.cxx \
$(top_srcdir)/src/sivers/Torino2009.cxx \
$(top_srcdir)/src/sivers/Positivity.cxx \
$(top_srcdir)/src/SofferBound.cxx \
$(top_srcdir)/src/SofferBoundProkudin.cxx \
$(top_srcdir)/src/TF1J.cc \
$(top_srcdir)/src/TF2J.cc \
$(top_srcdir)/src/TF3J.cc \
$(top_srcdir)/src/transv_pdf.f \
$(top_srcdir)/src/TransversityProkudin.cxx \
tppmcDict.cpp

libtppmc_la_CPPFLAGS = \
-I$(top_srcdir)/include \
$(LHAPDF_INCDIR)

libtppmc_la_LIBADD = \
$(PYTHIA_LIBS) \
$(LHAPDF_LIBS) \
-lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint \
-lPostscript -lMatrix -lPhysics -lMathCore -lThread -lfreetype -lm -ldl \
-lEG -lEGPythia6

libtppmc_la_LDFLAGS = -version-info 0:0:0

bin_PROGRAMS = tppmc gensoft

tppmc_SOURCES = \
$(top_srcdir)/tppmc.cc \
$(top_srcdir)/src/akk.f \
$(top_srcdir)/src/DistributionQaFigures.cxx \
$(top_srcdir)/src/kkp.f \
$(top_srcdir)/src/Pythia6.cxx \
$(top_srcdir)/src/RandomSpin.cxx \
$(top_srcdir)/src/TAcceptParticle.cc

DICTHEADERS = \
$(top_srcdir)/include/tppmc/Application.h \
$(top_srcdir)/include/tppmc/Bins.h \
$(top_srcdir)/include/tppmc/CollinsFragmentation.h \
$(top_srcdir)/include/tppmc/CollinsKt.h \
$(top_srcdir)/include/tppmc/Configuration.h \
$(top_srcdir)/include/tppmc/ConstantFragmentation.h \
$(top_srcdir)/include/tppmc/Distributions.h \
$(top_srcdir)/include/tppmc/DssFragmentation.h \
$(top_srcdir)/include/tppmc/Dssv.h \
$(top_srcdir)/include/tppmc/Event.h \
$(top_srcdir)/include/tppmc/FragmentationFunction.h \
$(top_srcdir)/include/tppmc/Grv98Pdf.h \
$(top_srcdir)/include/tppmc/KeyedLists.h \
$(top_srcdir)/include/tppmc/Particle.h \
$(top_srcdir)/include/tppmc/sivers/Torino2009.h \
$(top_srcdir)/include/tppmc/sivers/Positivity.h \
$(top_srcdir)/include/tppmc/SofferBound.h \
$(top_srcdir)/include/tppmc/SofferBoundProkudin.h \
$(top_srcdir)/include/tppmc/TF1J.h \
$(top_srcdir)/include/tppmc/TF3J.h \
$(top_srcdir)/include/tppmc/TransversityProkudin.h

if ENABLE_LHAPDF_SUPPORT
libtppmc_la_SOURCES += $(top_srcdir)/src/LhapdfDistribution.cxx
DICTHEADERS += \
$(top_srcdir)/include/tppmc/LhapdfDistribution.h \
$(top_srcdir)/cint/LinkDefLhapdf.h
else
DICTHEADERS += \
$(top_srcdir)/cint/LinkDef.h
endif

# Needed to avoid "created both with libtool and without"
# error with Fortran file in both programme & library.
tppmc_FFLAGS = $(AM_FFLAGS)

tppmc_CPPFLAGS = \
-I$(top_srcdir)/include \
$(LHAPDF_INCDIR)

tppmcDict.cpp: $(DICTHEADERS)
	rootcint -f $@ -c -I$(top_srcdir)/include $(INCLUDES) $^

tppmc_LDADD = \
$(PYTHIA_LIBS) \
$(LHAPDF_LIBS) \
$(F_LIBS) \
-ltppmc

gensoft_SOURCES = \
$(top_srcdir)/gensoft.cc

gensoft_CPPFLAGS = \
-I$(top_srcdir)/include

gensoft_LDADD = \
$(PYTHIA_LIBS) \
-lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lfreetype -lm -ldl -lEG -lEGPythia6

clean-local:
	rm -f $(BUILT_SOURCES) *Dict*
